class xinshou extends eui.Component {
	private yaogan: roleControl;
	/**四号道具 */
	private daotime = Date.now();
	private rr = 0;
	public camera: control.Camera2D;
	public lenght11: number//舌头长度
	private background: eui.Group = new eui.Group();
	/**自己的青蛙 */
	private myFrog: control.frog;
	private brorder: eui.Group = new eui.Group();
	/**玩家类型 */
	private clothes_List = ["lv", "huang", "qing"];
	/**道具介绍面板 */
	private prop_message: prop_message;
	/**道具介绍面板显示次数 */
	private prop_messageTimes = 0;
	/**背景音乐 */
	//	private bgSound: soundMgr = new soundMgr();

	/**AI管理类 */
	//private aimgr: AIMgr;

	/**用于存储玩家是否死亡 控制是否接受服务器消息 */
	public isUserDied = false;
	public liubianxing: eui.Group;//背景添加六边形
	/**相关数据 */
	private con = gameGlobal;
	private config = this.con.global;//account

	//显示玩家的青蛙
	private myUser = { targetx: 0, targety: 0, userSprit: null };

	private get User() {
		return this.myUser.userSprit;
	}


	/**装饰品 */
	private decoration_List = ["lowpoly", "food"];
	/**线层*/
	private tongueLayer: egret.Sprite = new egret.Sprite();
	/**道具层 */
	public propLayer: egret.Sprite = new egret.Sprite();
	/**UI层 */
	private UiLayer: eui.Component = new eui.Component();
	/**游戏结束/死亡*/
	private GameOver: GameOver = new GameOver();
	/**玩家面板信息/用于显示玩家信息 */
	private playerPanel: playerPanel = new playerPanel(this);
	/**；存房间玩家/青蛙 动画的容器 */
	private gameFrog = new eui.Group();
	/**青蛙管理类 */
	public m_createAllFrogs = new frogMgr(this);
	/**房间内的线 */
	public roomAllTongue: egret.Sprite = new egret.Sprite();
	/**玩家死亡 */
	//private userDied: playerDied = new playerDied();

	private game_Timer: egret.Timer;

	/**道具管理 */
	private m_propMg: propMgr = new propMgr(this.propLayer);
	// /**缩放目标倍数 */
	// private zoomTarget: number = -1;
	// /**当前缩放倍数 */
	// private zoomNow: number = -1;
	public drawGroup: eui.Group;
	/**打字机定时器 */
	public typerTimer: egret.Timer;
	/**打字机消息号 */
	public typerNum: number;

	//新手引导界面
	public sceneType = 1;
	private tmptime: egret.Timer = new egret.Timer(1000 / 60, -1);
	/**创建 */
	public constructor() {
		super();
		this.skinName = "resource/assets/skins/gameMapSkin.exml";
		//st_config.setScreenAuto(this);
		this.addEventListener(egret.Event.ADDED_TO_STAGE, this.initialize, this);
	}
	/**初始化 */
	private initialize() {
		this.x -= 100 * DataProl.gameSceneScal;
		this.y -= 100 * DataProl.gameSceneScal;
		resManager.getInstance().loadRes();
		this.init();
		this.yaoganInit();
		this.parent.addChild(this.UiLayer);
		this.UiLayer.addChild(this.playerPanel);
		this.gameStart();
		this.changeVisibility(DataProl.gameSceneScal);
		// for (var i: number = 0; i < 6; i++) {//背景添加六边形
		// 	for (var t: number = 0; t < 7; t++) {
		// 		var bit: eui.Image = new eui.Image();
		// 		bit.texture = RES.getRes("liubianxing22_png");
		// 		bit.x = 496 * t + 248 * (i % 2);
		// 		bit.y = 431.25 * i;
		// 		this.liubianxing.addChild(bit);
		// 	}
		// }
	}
	private init() {
		//	GlobalData.changeDpi(this);
		DataProl.killnumMax = 0;
		DataProl.isXinShou = true;
		this.mapScaleInit();
		webNetworkMananger.getInstance().gameSceneRec = this;
		this.m_createAllFrogs.createAllFrogs();
		this.mapInit();
		//this.cameraInit();
		//this.camera.set
		this.creatMyFog();
		//this.camera.setTarget(null);
		this.myFrog = this.m_createAllFrogs.findFrogById(DataProl.account);//获取自己的青蛙
		// this.camera.checkLookAt();
		this.UiLayer.width = GlobalData.GameStage_width * DataProl.gameSceneScal;
		this.UiLayer.height = GlobalData.GameStage_height * DataProl.gameSceneScal;
		//this.UiLayer.addChild(this.userDied);
		this.UiLayer.addChild(this.GameOver);
		this.GameOver.visible = false;
		//this.userDied.visible = false;
		this.all_Prop_message();

	}

	private drawMap() {
		DrawMap.drawLineToGroup(this.drawGroup);
		/**打开  将方法里的变量修改下 */
		// DrawMap.drawHexagonToGroup(this.drawGroup);
		this.setChildIndex(this.drawGroup, 4);
		this.drawGroup.cacheAsBitmap = true;/**不要改 */
	}
	/**地图缩放初始化 */
	private mapScaleInit() {
		let scaleLayer = dynamicScaling.dynamicLayer;
		this.addChild(scaleLayer);
		this.changeParent("map");
		this.changeParent("background");
		this.changeParent("shitou");
		this.changeParent("brorder");
	}

	/**
	 * 改变父节点  仅限于此使用
	 */
	private changeParent(childName) {
		let obj = this.getChildByName(childName);
		this.removeChild(obj);
		dynamicScaling.addScalingObject(obj);
	}

    /**改变游戏内可见范围大小
	 * vis: 屏幕缩放比例
	 */
	public changeVisibility(vis) {
		egret.MainContext.instance.stage.setContentSize(gameGlobal.global.screenWidth * vis, gameGlobal.global.screenHeight * vis);
		//this.yaogan.changeVis(vis);
		// this.camera.changeVis(vis);
		this.playerPanel.changeVis(vis);
		this.GameOver.changeVis(vis);
		//this.userDied.changeVis(vis);
		//this.swapChildren(this.playerPanel, this.yaogan);//改变摇杆和遮罩进游戏动画的深度，进游戏后摇杆在前
	}
	public gameStart() {
		AIServer.getInstance().roomInit();

		//隐藏新手引导不要的UI

		this.playerPanel.hideGuideUi();
		this.BeginTimes();
		//this.myUser.userSprit = this.m_createAllFrogs.findFrogById(DataProl.account);
		this.playerPanel.startRoomTimer();
		this.playerPanel.gameCountDownTime.visible = false;//同时不显示倒计时
		/**生成六种道具 */
		this.setprop();
		this.yaogan.lockControl();

		/**生成一组连线青蛙 */
		//this.setLinefrog();
		/**生成一个青蛙 */
		//this.setOneAi();
		/**生成一个道具 */
		//this.setOneprop();
		//锁定吐舌

		AIServer.getInstance().setGuidPoint({ x: 200, y: 200 });

		this.lock_shoot();
		//跳过按钮锁定
		this.lock_skip();
		this.tmptime.addEventListener(egret.TimerEvent.TIMER, this.AIServerUpdate, this);
		this.tmptime.start();
		//AIServer.getInstance().updata();
		AIServer.getInstance().yaogan = this.yaogan;
	}
	//执行AIServer中的Updata方法
	private AIServerUpdate(event: egret.TimerEvent) {
		AIServer.getInstance().updata();
	}
	/*返回大厅 */
	public backToHall() {
		egret.MainContext.instance.stage.setContentSize(gameGlobal.global.screenWidth, gameGlobal.global.screenHeight);
		/**移除监听 避免一直发消息 */
		this.yaogan.clearYaogan();
		this.playerPanel.countDownTime = serverConfig.config.roomTime;//房间死亡不复活回大厅时间处理
		this.gameRest();
		SceneManager.instance.SitchScene(SceneName.登录场景);
	}
	public gameRest() {
		this.game_Timer.removeEventListener(egret.TimerEvent.TIMER, this.game_Loop, this);
		this.game_Timer.reset();
		this.tmptime.removeEventListener(egret.TimerEvent.TIMER, this.AIServerUpdate, this);
		this.tmptime.reset();
		AIServer.getInstance().gameOver();

	}

	public gameAgain() {
		DataProl.killnumMax = 0;
		this.gameRest();
		this.gameStart();
	}

	/**
	 * 摄像机初始化
	 */
	private cameraInit() {
		var cameraRect: egret.Rectangle = new egret.Rectangle(0, 0, GlobalData.GameStage_width * DataProl.gameSceneScal, GlobalData.GameStage_height * DataProl.gameSceneScal);
		this.camera = new control.Camera2D(this, cameraRect);

		// this.camera.addLayer(this.playerPanel);
		// this.camera.addLayer(this.GameOver);
		// this.camera.addLayer(this.yaogan);
		// this.camera.addLayer(this.userDied);
	}
	private onLoop(): void {
		this.camera.move();//相机随青蛙移动
	}
	/**地图初始化 */
	private mapInit() {
		/*房间的线 */
		dynamicScaling.addScalingObject(this.roomAllTongue);
		/**房间内的道具 */
		dynamicScaling.addScalingObject(this.propLayer);
		/**房间内的青蛙 */
		dynamicScaling.addScalingObject(this.gameFrog);
	}

	/**玩家死亡 */
	public playerDiedDis() {
		var User_list = AIServer.getInstance().getRoomUsers();
		this.GameOver.visible = true;
		this.GameOver.showTops(User_list);
		//this.userDied.GameOverDis();

	}
	/**游戏循环 */
	private game_Loop() {
		//this.aimgr.update();
		//this.accordingLineData();
		//this.displaMyInfo(this.myUser.userSprit);
		//this.playerUpdate();
		//this.checkDied();
		this.playerPanel.update();
		//this.onLoop();
		//this.check_can_breakLine();
		//this.tongueManager.updataTongue();
	}

	/**玩家伸舌 */
	public playerLoll() {
		this.m_createAllFrogs.frogLoll();
	}
	/**断线开关 */
	private breakLineSwitch: Boolean = false;
	/**检测是否可以断线 */
	private check_can_breakLine() {
		let m_switch = this.m_createAllFrogs.checkPlayerIsLine();
		this.breakLineSwitch = m_switch
		if (m_switch) {
			this.playerPanel.coolDown.visible = false;
			this.playerPanel.breakLine.visible = true;
			this.playerPanel.ligature.visible = false;
		} else {
			this.playerPanel.breakLine.visible = false;
			this.playerPanel.ligature.visible = true;
		}
	}
	/**定时器*/
	private BeginTimes() {
		this.game_Timer = new egret.Timer(1000 / 60, 0);
		this.game_Timer.addEventListener(egret.TimerEvent.TIMER, this.game_Loop, this);
		this.game_Timer.start();
		let game_TimerT = new egret.Timer(1000, 0);
		game_TimerT.addEventListener(egret.TimerEvent.TIMER, this.showTip, this);
		game_TimerT.start();
	}
	private showTip() {
		//this.isShowTop = false;
	}
	/**处理服务器发来的消息 */
	public handleInformationByServer(playerdata: any) {
		if (this.isUserDied)
			return;
		//	this.playerPanel.serverHertBeatUpdata((new Date()).valueOf());//(Date.parse(new Date().toString()));
		var porpsData = playerdata.foodsList;
		var lineData = playerdata.lineList;
		var userData = playerdata.userData;
		var virusData = playerdata.virusList;

		if (porpsData != null) {
			/**更新道具 */
			this.m_propMg.propsUpdata(porpsData);
		}
		if (userData != null) {

			// if (this.isShowTop) {
			// 	/**玩家排行榜 */
			// 	this.playerPanel.disposAllUser(userData);
			// 	this.isShowTop = false;
			// }
			//处理青蛙的移动
			this.m_createAllFrogs.disposeRoomUserMessage(userData);
			this.changebutton(userData);
			//this.diedLeaf(userData);
		}
		if (lineData != null) {
			/**处理玩家身上的线 */
			this.tongueManager.gameTongueDataUpdata(userData, lineData);
			//this.newTongueMgr.disposeRoomTongueMessage(userData, lineData);
		}

	}
	/**飞行动画中关闭吐舌 断线按钮 */
	public changebutton(userData) {
		for (var e of userData) {
			if (e.userId == DataProl.account) {
				if (e.states != 0) {
					this.playerPanel.breakLine.touchEnabled = false;
					this.playerPanel.ligature.touchEnabled = false;
				}
				else {
					this.playerPanel.breakLine.touchEnabled = true;
					this.playerPanel.ligature.touchEnabled = true;
				}
			}
		}
	}
	/**显示击杀效果 */
	public disPlayKillMan(num: number) {
		var time11 = new egret.Timer(1200, 1)
		time11.start()
		time11.addEventListener(egret.TimerEvent.TIMER, (eve: egret.Event) => {
			var visible = DataProl.gameSceneScal + this.lenght11 / 2500
			if (visible >= 2) {
				visible = 2;
			}

		}, this)
		if (num > DataProl.killnumMax) {
			DataProl.killnumMax = num;
		}
		//console.log(DataProl.killnumMax + "最高连杀");
		this.playerPanel.frogKillMan(num);
		//SoundManager.getInstance().effectSound = null;
		if (num == 1) {
			SoundManager.getInstance().playEffectSound("firstblood_mp3");
		}
		else if (num == 2) {
			SoundManager.getInstance().playEffectSound("doublekill_mp3");
		}
		else if (num == 3) {
			SoundManager.getInstance().playEffectSound("triplekill_mp3");
		}
		else if (num == 4) {
			SoundManager.getInstance().playEffectSound("quatarykill_mp3");
		}
		else if (num == 5) {
			SoundManager.getInstance().playEffectSound("pentakill_mp3");
		}
		else if (num > 5 && num <= 10) {
			SoundManager.getInstance().playEffectSound("killingspree_mp3");
		}
		else if (num > 10 && num <= 20) {
			SoundManager.getInstance().playEffectSound("monsterkill_mp3");
		}
		else if (num > 20 && num <= 30) {
			SoundManager.getInstance().playEffectSound("godlike_mp3");
		}
		else if (num > 30) {
			SoundManager.getInstance().playEffectSound("legendary_mp3");
		}

	}

	/**将玩家信息显示出来 */
	public displaMyInfo(player: any) {
		this.lenght11 = player.lineLength;
		this.playerPanel.displayUserTongueLength(player.grade);
		var playertyp = player.frogType + 1 >= serverConfig.config.maxtype + 1 ? 0 : player.frogType + 1;
		this.playerPanel.displayUserClothesUpdata(playertyp);
	}
	/**初始化摇杆 */
	private yaoganInit() {
		this.yaogan = new roleControl();
		this.UiLayer.addChild(this.yaogan);
		this.yaogan.yaoganInit(this.stage);

		this.lockControl();
	}

	// 发送给服务器玩家的位置
	public senMessageForServerPosition(point) {

		if (this.myUser == null || this.myUser.userSprit == null)
			return;
		//道具醉酒
		if (this.myUser.userSprit.nowPropsType[3] == 4) {
			if (Date.now() - this.daotime >= 1000) {
				this.rr = Math.round(Math.random() * 360)
				this.daotime = Date.now();
			}
			point.x = Math.sin(this.rr / 57.3) * 815;
			point.y = Math.cos(this.rr / 57.3) * 815;
		}
		if (point.y == 0 && point.x == 0) {
			return;
		}
		var movedata = {
			"target": point,
		}

		AIServer.getInstance().clientMove(movedata);
	}
	/**生成一个道具 */
	public setOneprop() {

		AIPropsMgr.getInstance().NewbieOneProp(6, { x: GlobalData.GameStage_width * DataProl.gameSceneScal / 2 + 100, y: GlobalData.GameStage_height * DataProl.gameSceneScal / 2 + 100 });
	}
	/**生成六个道具 */

	private setprop() {
		for (var i = 0; i < 6; i++) {
			/**新手模式初始化道具 */
			AIPropsMgr.getInstance().NewbieProp(i);
			//console.log(AIPropsMgr.getInstance().NewbieProp(i));

		}
	}
	/**设置一个青蛙 */

	private setOneAi(x: number, y: number) {
		AIServer.getInstance().creatOneAifrog(3, { x: x, y: y })
	}
	/**设置一组连线青蛙 */
	private setLinefrog(x1: number, y1: number, x2: number, y2: number, level: number) {
		/**参数为 青蛙颜色 两只青蛙位置 */
		AIServer.getInstance().createLinefrog(3, new egret.Point(x1, y1), new egret.Point(x2, y2), level);
	}
	/**删除一组连线青蛙 */
	private delteFiretLinefrog(AI1: number, AI2: number) {
		AIServer.getInstance().deleteLineFrog(AI1, AI2);
	}
	/**更改单个青蛙颜色 */
	private setAitype() {
		AIServer.getInstance().setAitype(this.myFrog.type);
	}
	/**清空房间内ai */
	private resetAI() {
		AIServer.getInstance().resetAi();

	}
	/**清空房间内道具 */
	public reset_allprop() {
		AIPropsMgr.getInstance().cleanRoomAI()
	}
	/**设置玩家青蛙的位置 */
	private set_player_Point(x: number, y: number) {
		var player = AIServer.getInstance().setPlayer(x, y);
	}
	/**设置青蛙转向 */
	private set_player_Veer() {
		AIServer.getInstance().setAIlevel(9000);
		this.myFrog.visible = true;
		this.myFrog.rotation = 90;
	}
	/**摇杆锁定 */
	private lockControl() {
		if (this.yaogan == null)
			return;
		this.yaogan.recoverHandle2();//复原小球位置
		this.yaogan.lockControl();//摇杆锁定
		this.yaogan.visible = false;//初始摇杆隐藏
	}
	/**摇杆解锁 */
	private unlockControl() {
		if (this.yaogan == null)
			return;
		this.yaogan.unlockControl();//摇杆解锁
		this.yaogan.visible = true;//初始摇杆隐藏
	}
	/**摇杆小球偏移 */
	private ControlMove(x: number, y: number) {
		if (this.yaogan == null)
			return;
		this.yaogan.recoverHandle3(x, y);//小球偏移
		this.yaogan.lockControl();//此时摇杆锁定，会使玩家朝小球偏移的方向移动
		this.yaogan.visible = false;//初始摇杆隐藏
	}
	/**吐舌按钮锁定 */
	private lock_shoot() {
		this.check_can_breakLine();
		this.playerPanel.lock_tongue();//吐舌按钮锁定
	}
	/**吐舌按钮解锁 */
	private unlock_shoot() {
		this.check_can_breakLine();
		this.playerPanel.unlock_tongue();//吐舌按钮解锁
	}
	/**跳过按钮锁定 */
	private lock_skip() {
		this.playerPanel.lock_skip();
	}
	/**跳过按钮解锁 */
	private unlock_skip() {
		this.playerPanel.unlock_skip();
	}
	/**重置玩家状态 */
	private restPlayer() {
		var player = AIUserMgr.getInstance().get(DataProl.account);
		AIUserMgr.getInstance().resetPlayer(player);//重置玩家状态
		this.myFrog.reset2();
	}
	/**场景2 */
	private set_scene2() {
		this.reset_allprop();
		this.restPlayer();
		this.set_player_Point(GlobalData.GameStage_width * DataProl.gameSceneScal / 6 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 2 + 100);
		this.myFrog.visible = false;
		this.setLinefrog(GlobalData.GameStage_width * DataProl.gameSceneScal / 3 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 4 + 100, GlobalData.GameStage_width * DataProl.gameSceneScal / 3 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 4 * 3 + 100, 12);//设置一组连线青蛙 
		this.setOneprop();
		this.lockControl();
		this.yaogan.visible = false;
		this.prop_messageTimes = 7;
		this.lock_shoot();
		this.displayer_message(this.prop_messageTimes, 1000, 600);
		egret.setTimeout(this.set_player_Veer, this, 200);
		//this.set_player_Veer();
	}

	//提交玩家自己的青蛙
	public creatMyFog() {
		this.m_createAllFrogs.getMyFrog(DataProl.account, DataProl.login_data.nickName, 200, 200, 0, 0, DataProl.userCurrentDressUp);
		this.myUser.targetx = this.myUser.userSprit.x;
		this.myUser.targety = this.myUser.userSprit.y;
	}
	public tongueManager: tongueMgr = new tongueMgr(this.roomAllTongue, this.m_createAllFrogs);
	/**道具信息数组 */
	protected text_array = new Array();
	/**道具信息面板数组 */
	public message_array = new Array();
	private all_Prop_message() {
		var hide_message = "会,使,青,蛙,处,于,一,小,段,时,间,的,隐,形,状,态";
		var ice_message = "会使,青,蛙,冻,结,一,小,段,时,间";
		var cut_message = "持,有,一,段,时,间,的,剪,刀,，,可,以,突,破,对,方,的,舌,网";
		var drink_message = "会,使,青,蛙,喝,醉,，,混,乱,不,受,控,制,一,小,段,时,间";
		var bianse_message = "可,以,改,变,青,蛙,的,颜,色";
		var heye_message = "收,集,荷,叶,会,让,小,蝌,蚪,快,速,成,长";
		var prorEnd = "全,部,道,具,都,已,经,了,解,，,让,我,们,开,始,下,一,部,分";
		var shoot = "让,我,们,尝,试,一,下,舌,头,的,威,力,吧";
		var shoot_prop = "你,用,舌,头,进,行,了,一,次,跳,跃,，,翻,过,了,对,方,的,舌,网";
		var shoot_frog_same = "不,同,颜,色,的,青,蛙,是,不,能,组,成,搭,档,的,哟,!";
		var shoot_frog_different = "太,棒,了,!,黄,色,小,青,蛙,接,受,了,你,的,舌,约,，,让,我,们,尝,试,一,下,断,线,操,作,吧,！";
		var died_mseeage = "碰,触,到,对,方,舌,网,会,被,击,杀,的,哦,！";
		var collide_message = "身,体,的,对,抗,会,让,自,己,和,对,方,都,感,到,头,晕,哦";
		var brinkLine = "断,开,舌,网,会,失,去,攻,击,手,段,哦,，,快,快,找,到,搭,档,重,新,连,接,舌,网,吧,！";
		var kill = "太,厉,害,了,，,你,成,功,的,打,败,了,一,只,青,蛙,。";
		var end = "恭,喜,你,完,成,新,手,教,程, ,返,回,大,厅,";
		let msg1 = hide_message.split(",");
		let msg2 = ice_message.split(",");
		let msg3 = cut_message.split(",");
		let msg4 = drink_message.split(",");
		let msg5 = bianse_message.split(",");
		let msg6 = heye_message.split(",");
		let msg7 = prorEnd.split(",");
		let msg8 = shoot.split(",");
		let msg9 = shoot_prop.split(",");
		let msg10 = shoot_frog_same.split(",");
		let msg11 = shoot_frog_different.split(",");
		let msg12 = died_mseeage.split(",");
		let msg13 = collide_message.split(",");
		let msg14 = brinkLine.split(",");
		let msg15 = kill.split(",");
		let msg16 = end.split(",");
		let propMsg = [
			"会使青蛙处于一小段时间的隐形状态",
			"会使青蛙冻结一小段时间",
			"持有一段时间的剪刀，可以突破对方的舌网",
			"会使青蛙喝醉，混乱不受控制一小段时间",
			"可以改变青蛙的颜色",
			"收集荷叶会让小蝌蚪快速成长"]

		this.text_array = [msg6, msg5, msg2, msg1, msg3, msg4,
			msg7, msg8, msg9, msg10, msg11, msg12, msg13, msg14, msg15, msg16];
		var listnum = -1;
		/**信息位置 */
		let msgPoint;
		/**面板尺寸 */
		let mainSize = GlobalData.GameStage.stageHeight / 4 * DataProl.gameSceneScal;
		for (let i: number = 0; i < 6; i++) {//添加六个面板
			msgPoint = AIPropsMgr.getInstance().getPropPutPoint(i);
			listnum++;
			var prop_message0 = new prop_message();
			prop_message0.anchorOffsetX = prop_message0.width / 2;
			prop_message0.anchorOffsetY = -50;
			//prop_message0.scaleX = prop_message0.scaleY = mainSize / prop_message0.height;
			prop_message0.jieshao1.text = propMsg[listnum];
			prop_message0.x = msgPoint.x * DataProl.gameSceneScal + 100;
			prop_message0.y = msgPoint.y * DataProl.gameSceneScal + 100;
			prop_message0.alpha = 0;
			this.message_array.push(prop_message0);
			this.addChild(prop_message0);
			egret.Tween.get(prop_message0)
				.to({ alpha: 1 }, 1000)
				.to({ alpha: 1 }, 1000)
				.to({ alpha: 0 }, 1000)
				.call(() => {
					if (listnum == 5) {
						this.unlockControl();//摇杆解锁
						this.unlock_skip();//跳过按钮解锁
					}
				}, this);
		}

		this.add_message(prorEnd, 6);
		for (let i: number = 7; i < this.text_array.length; i++) {//添加六个面板
			this.add_message(this.text_array[i], i);
		}
	}
	/**添加信息面板 */
	private add_message(message: string, num: number) {
		var prop_message0 = new prop_message();
		prop_message0.scaleX = prop_message0.scaleY = 1.5;
		prop_message0.jieshao1.text = message;
		prop_message0.alpha = 0;
		prop_message0.x = GlobalData.GameStage_width / 2;
		prop_message0.y = GlobalData.GameStage_height / 2;

		this.message_array.push(prop_message0);
		this.playerPanel.addChild(prop_message0);
	}
	/**新手引导  道具信息面板显示（渐入渐出） */
	public displayer_prop_message(num: number) {
		this.lockControl();//摇杆锁定
		this.lock_skip();
		if (this.prop_messageTimes > 6 && this.prop_messageTimes < 10) {
			this.displayer_message(this.prop_messageTimes, 800, 500);
			//生成第二组连线青蛙
			this.setLinefrog(GlobalData.GameStage_width * DataProl.gameSceneScal / 3 * 2 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 4 + 100, GlobalData.GameStage_width * DataProl.gameSceneScal / 3 * 2 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 4 * 3 + 100, 14);
			this.setOneAi(GlobalData.GameStage_width * DataProl.gameSceneScal / 6 * 5 + 100, GlobalData.GameStage_height * DataProl.gameSceneScal / 2 + 100);
			return;
		}
		this.prop_messageTimes++;
		this.message_array[num].jieshao1.text = null;
		this.message_array[num].anchorOffsetX = this.message_array[num].width / 2;
		this.message_array[num].anchorOffsetY = this.message_array[num].height / 2;
		this.message_array[num].scaleX = this.message_array[num].scaleY = 1.5;
		this.message_array[num].x = GlobalData.GameStage_width * DataProl.gameSceneScal / 2 + 100;
		this.message_array[num].y = GlobalData.GameStage_height * DataProl.gameSceneScal / 2 + 100;
		egret.Tween.get(this.message_array[num])
			.to({ alpha: 1 }, 500)
			.call(() => {
				this.typer(num);
			}, this);
	}
	/**新手引导  单个信息面板显示（渐入渐出） */
	public displayer_message(num: number, x: number, y: number, ) {
		this.lockControl();//摇杆锁定
		this.lock_skip();

		this.prop_messageTimes++;
		this.message_array[num].anchorOffsetX = this.message_array[num].width / 2;
		this.message_array[num].anchorOffsetY = this.message_array[num].height / 2;
		this.message_array[num].x = this.playerPanel.width / 2;
		this.message_array[num].y = this.playerPanel.height / 2;

		if (num == 14) {
		//egret.setTimeout(() => { this.lock_skip(); }, this, 2000)
			this.lock_shoot()
			this.add_message_to_playerPanel(num, this.playerPanel.width / 2, this.playerPanel.height / 2);
			this.delteFiretLinefrog(3, 4);

		}

		if (num == 15) {
	
			this.lock_shoot()
			this.add_message_to_playerPanel(num, this.playerPanel.width / 2, this.playerPanel.height / 2);
			this.prop_messageTimes = -1;
		}

		if (num == 7 || num == 13) {
			
			this.playerPanel.width / 2, this.playerPanel.height / 2
			this.add_message_to_playerPanel(num, this.playerPanel.width / 2, this.playerPanel.height / 2);
		}
		if (num == 8 || num == 9 || num == 10 || num == 13 || num == 11) {
			this.lock_shoot();
		}
		this.message_array[num].jieshao1.text = null;
		egret.Tween.get(this.message_array[num])
			.to({ alpha: 1 }, 500)
			.call(() => {
				this.typer(num);
			}, this);
	}
	/**打字机
	 * @param num 信息面板号
	 */
	public typer(num: number) {
		this.typerNum = num;
		this.typerTimer = new egret.Timer(150, this.text_array[this.typerNum].length);

		this.typerTimer.addEventListener(egret.TimerEvent.TIMER, this.showTyper, this);
		//道具面板处理
		if (this.prop_messageTimes <= 6 && this.prop_messageTimes > 0) {
			this.typerTimer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.dealPropTyper, this);
		} else {
			this.typerTimer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this.dealOneTyper, this);
		}
		this.typerTimer.start();
	}
	/**打字机显示 */
	public showTyper() {
		this.message_array[this.typerNum].jieshao1.text += this.text_array[this.typerNum][this.typerTimer.currentCount - 1];
	}
	/**移除打字机侦听 */
	public removeTyperListen() {
		this.typerTimer.stop();
		this.typerTimer.removeEventListener(egret.TimerEvent.TIMER, this.showTyper, this);
		//道具面板处理
		if (this.prop_messageTimes <= 6 && this.prop_messageTimes > 0) {
			this.typerTimer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.dealPropTyper, this);
		} else {
			this.typerTimer.removeEventListener(egret.TimerEvent.TIMER_COMPLETE, this.dealOneTyper, this);
		}
	}
	/**处理道具打字机消息 */
	public dealPropTyper() {
		this.removeTyperListen();
		egret.Tween.get(this.message_array[this.typerNum])
			.to({ alpha: 0 }, 500)
			.call(() => {
				this.typerNum = -1;
				this.unlockControl();//摇杆解锁
				this.unlock_skip();
				if (this.prop_messageTimes == 6) {
					egret.Tween.get(this.yaogan)
						.to({ alpha: 1 }, 1000)
						.call(() => {
							if (this.prop_messageTimes == 9) {
								return;
							}
							this.displayer_message(6, this.playerPanel.width / 2, this.playerPanel.height / 2);
						}, this);
				}
			}, this);
	}
	/**处理单个打字机消息 */
	public dealOneTyper() {
		this.removeTyperListen();
		egret.Tween.get(this.message_array[this.typerNum])
			.to({ alpha: 0 }, 500)
			.call(() => {
				this.typerNum = -1;
				this.unlock_skip();
				if (this.prop_messageTimes == 7) {
					this.lock_skip()
					this.set_scene2();
					return;
				} else if (this.prop_messageTimes == 8 || this.prop_messageTimes == 9 || this.prop_messageTimes == 12) {
					if (this.prop_messageTimes == 12) {
						this.myFrog.rotation = 90;
					}
					this.unlock_shoot();
					return;
				}
				else if (this.prop_messageTimes == 10) {
					this.setAitype();
					this.unlock_shoot();
					return;
				} else if (this.prop_messageTimes == 11) {
					this.unlock_shoot();//摇杆解锁
					this.delteFiretLinefrog(1, 2);
					return;
				}
				else if (this.prop_messageTimes == 13) {
					this.lock_shoot();
					//this.unlockControl();
					this.ControlMove(-5, -10);//通过程序控制摇杆，使玩家向左上移动
					setTimeout(() => {
						//this.unlockControl();
						this.ControlMove(5, 10);//通过程序控制摇杆，使玩家向右下移动
					}, 500);
					return;
				}
				else if (this.prop_messageTimes == 14) {
					this.lock_shoot();
					this.lock_skip()
					egret.setTimeout(() => { this.displayer_message(15, 500, 500); }, this, 2000)
					return;
				}
				else if (this.prop_messageTimes == 0) {
					this.displayer_message(15, 500, 500);
					return;
				}
				//**跳转到主场景 */
				else if (this.prop_messageTimes == -1) {
					DataProl.isXinShou = false;
					MiniNet.post('https://praying715.cn', '/wechat/isFirst', 'userid=' + DataProl.account, this, function () {
						DataProl.xinshouyindao = 1;
					});
					this.backToHall();
					return;
				}
			}, this);

	}

	/**添加信息面板到玩家面板层 playerPanel*/
	private add_message_to_playerPanel(num: number, x: number, y: number) {
		this.playerPanel.addChild(this.message_array[num]);
		this.message_array[num].x = x;
		this.message_array[num].y = y;
	}
}
/**道具介绍面板 */
class prop_message extends eui.Component {
	public beijing: eui.Image;
	public jieshao1: eui.Label;
	public daoju: eui.Group;
	public ti: eui.Group
	/**青蛙动画显示层 */
	public frogShowLayer: eui.Component;
	public constructor() {
		super();
		this.skinName = "resource/assets/skins/wenzhi.exml";
		this.init()
	}
	public init() {

		this.frogShowLayer = new eui.Component();
		this.addChild(this.frogShowLayer);
	}
}